package spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
import pojo.User;

public class icoTest2 {
    public static void main(String[] args) throws ClassNotFoundException {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("userBeans.xml");
//        User user2 = (User) applicationContext.getBean("u1");
//        User user3 = (User) applicationContext.getBean("u2");
//        User user4 = (User) applicationContext.getBean("u3");
//        user2.show();
//        user3.show();
//        user4.show();
        User bean = (User) applicationContext.getBean(Class.forName("pojo.User"));
        bean.show();
    }
}
